<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>更改会员信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>CSS/style.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-validation-1.13.1/demo/css/screen.css">
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/external/jquery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-validation-1.13.1/dist/jquery.validate.js"></script>
  	<% String memberID = session.getAttribute("memberID").toString(); %>
  	<script>
  		$(function(){
  			//动态获取个人信息
  			$.ajax({
  				url:"<%=basePath%>memberAction?memID=<%=memberID%>",
  				type:'GET',
  				dataType:'json',
  				timeout:1000,
  				beforeSend:LoadFunction,
  				error:errFunction,
  				success:succFunction
  			});
  			
  			$("#userform").validate({
  			 	rules:{
  			 		number:"required",
  			 		password:{required:true,minlength:6},
  			 		password2:"required",
  			 		name:"required",
  			 		borth:{required:true,dateISO:true},
  			 		homeaddr:"required",
  			 		indate:{required:true,digits:true},
  			 		shschool:"required",
  			 		email:{
  			 			required: true,
  			 			email: true
  			 		}			 		
  			 	},
  			 	messages:{
  			 		number:"请输入用户名",
  			 		password:{required:"请更改新密码",minlength:"密码不少于六位"},
  			 		password2:"请输入确认密码",
  			 		name:"请输入姓名",
  			 		borth:{required:"请输入出生日期",dateISO:"请输入正确日期格式"},
  			 		homeaddr:"请输入家乡地址",
  			 		indate:{required:"请输入入学年份",digits:"请输入正确年份"},
  			 		shschool:"请输入毕业高中",
  			 		email:{
  			 			required: "请输入Email地址",
  			 			email:"请输入正确的Email地址"
  			 		}	
  			 	}
  			 });
  		});
  		
  		function LoadFunction(){} //加载函数
  			//失败函数
  			function errFunction(){
  				alert("数据加载失败！请刷新");
  				}
  				function succFunction(tt){
  				var json = eval(tt);
  				 $("#memberDiv").show();
  				$("#number").val(json[0].number);
  				 $("#name").val(json[0].memname);
  				  $("#sex").val(json[0].gender);
  				 $("#borth").val(json[0].borthday);
  				 $("#homeaddr").val(json[0].homeAddr);
  				 $("#indate").val(json[0].indate);
  				 $("#shschool").val(json[0].shschool);
  				 $("#college").val(json[0].college);
  				 $("#major").val(json[0].major);
  				 $("#schooladdr").val(json[0].schooladdr);
  				 $("#phone").val(json[0].phone);
  				 $("#cornet").val(json[0].cornet);
  				 $("#email").val(json[0].email);
  				 $("#workaddr").val(json[0].workaddr);
  				$("#worktype").val(json[0].worktype);			
  				$("#position").val(json[0].position);
  				$("#detail").val(json[0].detail);
  				}
  				//$.validator.setDefaults({
  				//	submitHandler: function() {
  				//		from.submit();
  				//	}
  				//});
  </script>

  </head>
  
  <body>
    <div id="head-search">
   	 	<i class="home-path"></i>
   	 	<span class="path-font">会员信息管理&nbsp;&nbsp;>>&nbsp;&nbsp;更改个人信息</span>
   		<button style="float:right;" onclick="javascript:$('#userform').submit();" class="wong-button-text-ui wong-button-blue">
   			<span class="wong-ui-icon wong-icon-save"></span>
   			<span >保存</span>
   		</button>
   	</div>
  	 <div class="memberbody">
   	 		<form method="post" action="<%=basePath %>modifyMemberAction" id="userform" name="userform">
   	 		<div class="memberleft">
   	 			<div class="divrow">	用&nbsp;户&nbsp;名:<input id="number" name="number"></input></div>	
   				<div class="divrow">	姓&nbsp;&nbsp;&nbsp;&nbsp;名:<input id="name"  name="name"></input></div>
  				<div class="divrow">	性&nbsp;&nbsp;&nbsp;&nbsp;别:<input id="sex"  name="sex"></input></div>
				<div class="divrow">	出生年月:<input id="borth"  name="borth"></input ></div>
  				<div class="divrow">	家乡地址:<input id="homeaddr" name="homeaddr"></input></div>
  				<div class="divrow">	入校年份:<input id="indate" name="indate"></input></div>
  				<div class="divrow">	毕业高中:<input id="shschool" name="shschool"></input></div>
  				<div class="divrow">	学&nbsp;&nbsp;&nbsp;&nbsp;院:<input id="college" name="college"></input></div>
  				<div class="divrow">	专&nbsp;&nbsp;&nbsp;&nbsp;业:<input id="major" name="major"></input></div>
   	 		</div>
  
   	 		<div class="memberright">
   	 			<div class="divrow">	学校住址:<input id="schooladdr" name="schooladdr"></input></div>
  				<div class="divrow">	联系电话:<input id="phone" name="phone"></input></div>
  				<div class="divrow">	短&nbsp;&nbsp;&nbsp;&nbsp;号:<input id="cornet" name="cornet"></input></div>
  				<div class="divrow">	邮&nbsp;&nbsp;&nbsp;&nbsp;箱:<input id="email" name="email"></input></div>
  				<div class="divrow">	工作地点:<input id="workaddr" name="workaddr"></input></div>
  				<div class="divrow">	工作类型:<input id="worktype" name="worktype"></input></div>
  				<div class="divrow">	同乡职位:<input id="position" name="position"></input>	</div>
  				</div>
   	 		 <div class="memberbottom">	
   	 			 <div>	个人简介:<textarea id="detail" name="detail" rows="6" cols="80"></textarea></div>	
   	 		</div>
   	 		 </form>
   	  	</div>
   	


<!-- 
 	<div id="memberDiv" class="member-show">
   		<form method="post" action="<%=basePath %>modifyMemberAction" id="userform" name="userform">
   		<div class="member-property-list">	用&nbsp;户&nbsp;名:<input id="number" name="number"></input></div>
   		
   		<div class="member-property-list">	旧&nbsp;密&nbsp;码:<input type="password" name="oldpassword" id="oldpassword" /></div>
   		<div class="member-property-list">	新&nbsp;密&nbsp;码:<input type="password" name="password" id="password" /></div>
  	   	<div class="member-property-list">	确认密码:<input type="password" name="password2" id="password2" /></div>
   		
   		<div class="member-property-list">	姓&nbsp;&nbsp;&nbsp;&nbsp;名:<input id="name"  name="name"></input></div>
  		<div class="member-property-list">	性&nbsp;&nbsp;&nbsp;&nbsp;别:<input id="sex"  name="sex"></input></div>
		<div class="member-property-list">	出生年月:<input id="borth"  name="borth"></input ></div>
  		<div class="member-property-list">	家乡地址:<input id="homeaddr" name="homeaddr"></input></div>
  		<div class="member-property-list">	入校年份:<input id="indate" name="indate"></input></div>
  		<div class="member-property-list">	毕业高中:<input id="shschool" name="shschool"></input></div>
  		<div class="member-property-list">	学&nbsp;&nbsp;&nbsp;&nbsp;院:<input id="college" name="college"></input></div>
  		<div class="member-property-list">	专&nbsp;&nbsp;&nbsp;&nbsp;业:<input id="major" name="major"></input></div>
  		<div class="member-property-list">	学校住址:<input id="schooladdr" name="schooladdr"></input></div>
  		<div class="member-property-list">	联系电话:<input id="phone" name="phone"></input></div>
  		<div class="member-property-list">	短&nbsp;&nbsp;&nbsp;&nbsp;号:<input id="cornet" name="cornet"></input></div>
  		<div class="member-property-list">	邮&nbsp;&nbsp;&nbsp;&nbsp;箱:<input id="email" name="email"></input></div>
  		<div class="member-property-list">	工作地点:<input id="workaddr" name="workaddr"></input></div>
  		<div class="member-property-list">	工作类型:<input id="worktype" name="worktype"></input></div>
  		<div class="member-property-list">	同乡职位:<input id="position" name="position"></input>	</div>
  		<div class="member-property-list">	个人简介:<textarea id="detail" name="detail"></textarea></div>
  		<div><input type="submit"  value="保存信息" >
  			
  			  <button class="button">
  				<span class="ui-icon "></span>
  				<span class="ui-button-text">保存信息</span>
  			  </button>
  				 
  			</div>
  			</form>
  	
   	</div> -->
  </body>
  </body>
</html>
